/**
 * @ClassName LC3033
 * @Author ykx
 * @Date 2024/7/5 21:56
 * @Version 1.0
 */
public class LC3033 {
    public int[][] modifiedMatrix(int[][] matrix) {
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[i].length; j++) {
                if (matrix[i][j] == -1) {
                    int max = matrix[0][j];
                    for (int[] ints : matrix) {
                        if (ints[j] > max) {
                            max = ints[j];
                        }
                    }
                    matrix[i][j] = max;
                }
            }
        }
        return matrix;
    }


}
